import request from '@/utils/request'

// 获取商品属性分类列表
export const fetchProductAttrCateList = (params) => {
    return request({
        url: '/productAttribute/category/list',
        method: 'get',
        params: params
    })
}

// 创建商品属性分类
export const createProductAttrCate = (data) => {
    return request({
        url: '/productAttribute/category/create',
        method: 'post',
        data: data
    })
}

// 删除商品属性分类
export const deleteProductAttrCate = (id) => {
    return request({
        url: '/productAttribute/category/delete/' + id,
        method: 'get'
    })
}

// 更新商品属性分类
export const updateProductAttrCate = (id, data) => {
    return request({
        url: '/productAttribute/category/update/' + id,
        method: 'post',
        data: data
    })
}

// 获取商品属性分类列表（带属性）
export const fetchWithAttrList = () => {
    return request({
        url: '/productAttribute/category/list/withAttr',
        method: 'get'
    })
}
